Skip to content

feat: add preview with no window picker action #2464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 15, 2023

Conversation

umlx5h
Copy link
Contributor

@umlx5h umlx5h commented Oct 12, 2023

Hi.

I often use preview feature, But if there is more than one window, It always prompts picker selection menu.
But I don't want to disable picker feature entirely.

I think that the option to not use the picker should be provided in preview as well, since it is the same kind of functionality as 'Open'.

When I set 'Open Preview: No Window Picker' to match 'Open: No Window Picker', the help message became too long horizontally.
So I chose 'Open Preview: No Picker'.

Feel free to change the name if you like.

I ran this script and githooks.

$ scripts/update-help.sh

no indent diff
https://github.com/nvim-tree/nvim-tree.lua/pull/2464/files?w=1

@umlx5h umlx5h force-pushed the add_preview_with_no_picker branch from f52f8ad to 5f48779 Compare October 14, 2023 13:10
@alex-courtis
Copy link
Member

So I chose 'Open Preview: No Picker'.

I like that.

Updating the API to match.

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested OK:

  • node.name == ".."
  • node.nodes
  • else

Many thanks for your contribution!

@@ -171,16 +171,6 @@ local function open_or_expand_or_dir_up(mode)
end
end

local function open_preview(node)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup.

@alex-courtis alex-courtis merged commit aaee4cd into nvim-tree:master Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants